package lab02.test03;


public class Student {

    //属性：计算机成绩、数学成绩、英语成绩
    float computerScore;
    float matchScore;
    float englishScore;

    //行为：总分、平均分、最高分、最低分，并且可以输出一个学生的完整信息。
    //总分
    private float sum(){

        return computerScore+matchScore+englishScore;
    }

    //平均分
    private float average(){

        return (computerScore+matchScore+englishScore)/3;
    }

    //最高分
    private float maxScore(){
        float maxScore=computerScore>matchScore?computerScore:matchScore;
        maxScore=maxScore>englishScore?maxScore:englishScore;
        return maxScore;
    }

    //最低分
    private float minScore(){
        float minScore=computerScore<matchScore?computerScore:matchScore;
        minScore=minScore<englishScore?minScore:englishScore;
        return minScore;
    }

    //打印
    private void printStudent() {
        System.out.println(sum());
        System.out.println(average());
        System.out.println(maxScore());
        System.out.println(minScore());
    }

}
